package com.hbnu.pojo;

import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.io.Serializable;

/**
 * RoomMember复合主键类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RoomMemberKey implements Serializable {
    private Integer roomId;
    private String userId;
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        RoomMemberKey that = (RoomMemberKey) obj;
        return roomId != null ? roomId.equals(that.roomId) : that.roomId == null &&
               userId != null ? userId.equals(that.userId) : that.userId == null;
    }
    
    @Override
    public int hashCode() {
        int result = roomId != null ? roomId.hashCode() : 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        return result;
    }
}